package com.balabala.gym_system.mapper;

import com.balabala.gym_system.pojo.dto.CoachQueryDto;
import com.balabala.gym_system.pojo.entity.Coach;
import com.balabala.gym_system.pojo.vo.CoachQueryVo;
import com.balabala.gym_system.pojo.vo.CoachVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Author:zl
 * Date:2023/5/2 13:54
 */

public interface CoachMapper extends BaseMapper<Coach> {
    /**
     * 教练模糊查询
     * @param coachQueryDto
     * @return
     */
    List<CoachQueryVo> findCoachById(CoachQueryDto coachQueryDto) ;

    /**
     * 教练id查信息
     * @param id
     */
    @Select("select * from tb_coach ,tb_admin where tb_coach.admin_id=tb_admin.id and tb_coach.id=#{id}")
    CoachVo findById(Long id);

    /**
     * 查询所有教练
     * @return
     */
    @Select("select * from tb_coach ,tb_admin where tb_coach.admin_id=tb_admin.id")
    List<CoachVo> findAllName();
}
